#ifndef WXSSTRINGPROPERTY_H
#define WXSSTRINGPROPERTY_H

#include "wxsproperty.h"

class wxsStringProperty: public wxsProperty {
  public:
    wxsStringProperty( const wxString& PGName, const wxString& DataName, long Offset, bool IsLongString = true,
                       bool XmlStoreEmpty = false, const wxString& Default = wxEmptyString, int Priority = 100 );
    virtual const wxString GetTypeName() { return _T( "wxString" ); }
  protected:
    virtual void PGCreate( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Parent );
    virtual bool PGRead( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Id, long Index );
    virtual bool PGWrite( wxsPropertyContainer* Object, wxPropertyGridManager* Grid, wxPGId Id, long Index );
    virtual bool XmlRead( wxsPropertyContainer* Object, TiXmlElement* Element );
    virtual bool XmlWrite( wxsPropertyContainer* Object, TiXmlElement* Element );
    virtual bool PropStreamRead( wxsPropertyContainer* Object, wxsPropertyStream* Stream );
    virtual bool PropStreamWrite( wxsPropertyContainer* Object, wxsPropertyStream* Stream );

  private:
    long Offset;
    bool IsLongString;
    bool XmlStoreEmpty;
    wxString Default;
};

#define WXS_SHORT_STRING(ClassName,VarName,PGName,DataName,Default,XmlStoreEmpty) \
  { static wxsStringProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),false,XmlStoreEmpty,Default); \
    Property(_Property); }


#define WXS_STRING(ClassName,VarName,PGName,DataName,Default,XmlStoreEmpty) \
  { static wxsStringProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),true,XmlStoreEmpty,Default); \
    Property(_Property); }


#define WXS_SHORT_STRING_P(ClassName,VarName,PGName,DataName,Default,XmlStoreEmpty,Priority) \
  { static wxsStringProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),false,XmlStoreEmpty,Default,Priority); \
    Property(_Property); }


#define WXS_STRING_P(ClassName,VarName,PGName,DataName,Default,XmlStoreEmpty,Priority) \
  { static wxsStringProperty _Property(PGName,DataName,wxsOFFSET(ClassName,VarName),true,XmlStoreEmpty,Default,Priority); \
    Property(_Property); }

#endif
